package com.newbee.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class DemoServiceE {

    @Autowired
    private MockCallService mockCallService;

    @Autowired
    private DemoServiceD demoServiceD;

    @Resource(name = "traceAsyncExecutor")
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;

    public int funcE(int x) {
        mockCallService.sendAndCallback(String.valueOf(x * 100));
        threadPoolTaskExecutor.execute(() -> demoServiceD.funcD(x * 10));
        return 999;
    }
}
